package com.jt.demo1;

import com.jt.demo1.config.SpringConfig;
import com.jt.demo1.proxy.JDKProxy;
import com.jt.demo1.proxy.JdkProxy1;
import com.jt.demo1.proxy.TimeProxy;
import com.jt.demo1.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class TestTx {
    public static void main(String[] args) {
        ApplicationContext context =
                new AnnotationConfigApplicationContext(SpringConfig.class);
        //获取目标对象
        UserService target = context.getBean(UserService.class);
        //获取代理对象
        UserService getjdk = (UserService) JdkProxy1.getjdk(target);
        getjdk.addUser();
    }
}
